var HOT_CORNER_PRESSURE_THRESHOLD = 100; // pixels
var HOT_CORNER_PRESSURE_TIMEOUT = 1000; // ms
+const SCREEN_TRANSITION_DELAY = 250; // ms
+const SCREEN_TRANSITION_DURATION = 500; // ms
+
function isPopupMetaWindow(actor) {
switch (actor.meta_window.get_window_type()) {
case Meta.WindowType.DROPDOWN_MENU:
monitorManager.connect('monitors-changed',
this._monitorsChanged.bind(this));
this._monitorsChanged();
+
+ this.screenTransition = new ScreenTransition();
+ this.uiGroup.add_child(this.screenTransition);
+ this.screenTransition.add_constraint(new Clutter.BindConstraint({
+ source: this.uiGroup,
+ coordinate: Clutter.BindCoordinate.ALL,
+ }));
}
// This is called by Main after everything else is constructed
showOverview() {
this.overviewGroup.show();
+ this.screenTransition.hide();
this._inOverview = true;
this._updateVisibility();
hideOverview() {
this.overviewGroup.hide();
+ this.screenTransition.hide();
this._inOverview = false;
this._updateVisibility();
}
};
Signals.addSignalMethods(PressureBarrier.prototype);
+
+var ScreenTransition = GObject.registerClass(
+class ScreenTransition extends Clutter.Actor {
+ _init() {
+ super._init({ visible: false });
+ }
+
+ vfunc_hide() {
+ this.content = null;
+ super.vfunc_hide();
+ }
+
+ run() {
+ if (this.visible)
+ return;
+
+ Main.uiGroup.set_child_above_sibling(this, null);
+
+ const rect = new imports.gi.cairo.RectangleInt({
+ x: 0,
+ y: 0,
+ width: global.screen_width,
+ height: global.screen_height,
+ });
+ const [, , , scale] = global.stage.get_capture_final_size(rect);
+ this.content = global.stage.paint_to_content(rect, scale, Clutter.PaintFlag.NO_CURSORS);
+
+ this.opacity = 255;
+ this.show();
+
+ this.ease({
+ opacity: 0,
+ duration: SCREEN_TRANSITION_DURATION,
+ delay: SCREEN_TRANSITION_DELAY,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onStopped: () => this.hide(),
+ });
+ }
+});
invocation.return_value(GLib.Variant.new('(b)', [ungrabSucceeded]));
}
+ ScreenTransitionAsync(params, invocation) {
+ try {
+ this._senderChecker.checkInvocation(invocation);
+ } catch (e) {
+ invocation.return_gerror(e);
+ return;
+ }
+
+ Main.layoutManager.screenTransition.run();
+
+ invocation.return_value(null);
+ }
+
_emitAcceleratorActivated(action, device, timestamp) {
let destination = this._grabbedAccelerators.get(action);
if (!destination)